<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<!--{hook admin_sort_list_start.htm}-->

<div class="row">
	<div class="col-12">
		<div class="btn-group mb-3" role="group">
			<?php echo admin_tab_active($menu['shop']['tab'], 'review');?>
		</div>
		<div class="card">
			<div class="card-body">
				<form action="<?php echo url('shop-list');?>" method="post" id="form">
					<div class="table-responsive arrlist">
						<table class="table" style="min-width: 800px">
							<thead>
								<tr align="center">
									<th width="50">店铺id</th>
									<th width="80">名称</th>
									<th width="100" class="text-center">
										审核通过
									</th>
									<th width="100" class="text-center">
										审核拒绝
									</th>
								</tr>
							<thead>
							<tbody>
								<?php foreach($shoplist as $_sid=>$_shop) { ?>
								<tr align="center" rowid="<?php echo $_sid; ?>">
									<td class="50">
										<p class="">
											<?php echo $_shop['sid']; ?>
										</p>
									</td>
									<td class="50">
										<p class="">
											<?php echo $_shop['name']; ?>
										</p>
									</td>
									<td class="50">
										<button  type="button" sid="<?php echo $_shop['sid']; ?>" t='tg' class="btn btn-primary bt">
											点击通过
										</button >
									</td>
									<td class="50">
										<button  type="button" sid="<?php echo $_shop['sid']; ?>" t="jj" class="btn btn-primary bt">
											点击拒绝
										</button >
									</td>
									<!-- <td><a class="btn row_edit" role="button" tabindex="0">编辑</a></td> -->
									<!-- <td><a class="btn row_delete" role="button" tabindex="0">删除</a></td> -->
								</tr>
								<?php } ?>
							</tbody>
						</table>
					</div>
				</form>
				<p class="small text-grey">
					<?php echo lang('tips');?>：<?php echo lang('sort_edit_tip');?>
				</p>
			</div>
		</div>
	</div>
</div>


<!--{hook admin_sort_list_end.htm}-->



<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script type="text/javascript">
	var bt = $(".bt")
	var ck = $(".ck")
	bt.click(function(){
		t = $(this);
		sid = t.attr('sid')
		ts = t.attr('t')
		url = "<?php echo url('shop-review') ?>";
		data = {
			'sid': sid,
			'type':ts
		}
		console.log(data)
		$.xpost(url,data,function(code,message){
			if (code == 0) {
				$.alert(message);
				t.parent('td').parent('tr').hide();
			} else {
				$.alert(message);
			}
		})
	})
</script>

<!--{hook admin_sort_list_js.htm}-->